<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style></style>
  </head>
  <body>
    <div id="div">
      <p id="p">
        <button id="btn">开始</button>
      </p>
    </div>
  </body>
  <script>
    let div = document.getElementById('div')
    let p = document.getElementById('p')
    let btn = document.getElementById('btn')
    div.addEventListener(
      'click',
      function () {
        alert('事件流>div')
      }
    )
    p.addEventListener(
      'click',
      function () {
        alert('事件流>p')
      }
    )
    btn.addEventListener(
      'click',
      function (e) {
        e.stopPropagation()
        alert('事件流>btn')
      },
      true
    )
  </script>
</html>
